Kotlin Coroutines by Tutorials by By Filip Babić & By Luka Kordić

Kotlin Coroutines by Tutorials by By Filip Babić & By Luka Kordić

Author:By Filip Babić & By Luka Kordić
Language: eng
Format: epub
Publisher: Ray Wenderlich


You create the first coroutine that throws ArithmeticException().

You create the second coroutine that prints the cancelled status of the first one, delays its work for 5 seconds and catches a CancellationException which is thrown when supervisor is cancelled.

You wait for the completion of the first job. Then, you print the second child’s status to make sure that it is still active. After that, you cancel the supervisor and wait for the completion of the second child. At this point, catch block in secondChild will trigger because of the CancellationException.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.